//
//  LGMainViewController.m
//  dw
//
//  Created by Apple on 15/12/7.
//  Copyright © 2015年 Apple. All rights reserved.
//

#import "LGMainViewController.h"
#import "LGDiscoverViewController.h"
#import "LGShotrTableViewController.h"
#import "LGTopicTableViewController.h"
#import "LGMineViewController.h"
#import "LGNavigationController.h"

@interface LGMainViewController ()

@end

@implementation LGMainViewController

- (void)viewDidLoad {
    [super viewDidLoad];

    [self addChildViewControllers];

    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    
}

- (void)addChildViewControllers {
    
     [self addChildViewController:[[LGDiscoverViewController alloc] init] Title:@"发现" ImageName:@"find_normal"];
     [self addChildViewController:[[LGShotrTableViewController alloc] init] Title:@"晒物" ImageName:@"shai_normal"];
     [self addChildViewController:[[LGTopicTableViewController alloc] init] Title:@"众测" ImageName:@"publictest_normal"];
    
    UIStoryboard *sb = [UIStoryboard storyboardWithName:@"LGMineViewController" bundle:nil];
    LGMineViewController *VC = sb.instantiateInitialViewController;
    [self addChildViewController:VC Title:@"我" ImageName:@"usercenter_normal"];
    
    
//     [self addChildViewController:[[LGMainController alloc] init] Title:@"我" ImageName:@"usercenter_normal"];
 
}



- (void)addChildViewController:(UIViewController *)vc Title:(NSString *)title ImageName:(NSString *)imageName {
    
    vc.title = title;

    vc.tabBarItem.image = [UIImage imageNamed:imageName];
    
    LGNavigationController *nav = [[LGNavigationController alloc] initWithRootViewController:vc];
    
    [self addChildViewController:nav];
    
}

@end
